package 堆;

import 队列.数组队列.Queue;

public class PriorityQueue<E extends  Comparable<E>>
implements Queue<E> {
    private MaxHeap<E> maxHeap;

    public PriorityQueue() {
        this.maxHeap = new MaxHeap<>(100);
    }

    @Override
    public void enqueue(E e) {
        maxHeap.add(e);
    }

    @Override
    public E dequeue() {
        return maxHeap.deleteMax();
    }

    @Override
    public E getFront() {
        return maxHeap.getMax();
    }
    @Override
    public int getSize() {
        return maxHeap.getSize();
    }
    @Override
    public boolean isEmpty() {
        return maxHeap.isEmpty();
    }
}
